﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Upreader.Usenet.Nntp
{
    /// <summary>
    /// Declares a contract for the NNTP socket
    /// </summary>
    public interface INntpSocket
    {
        #region Properties

        /// <summary>
        /// Get or set a timeout for the connection
        /// </summary>
        int ConnectionTimeout { get; set; }

        /// <summary>
        /// Get the address of the server as a string
        /// </summary>
        string Address { get; }

        /// <summary>
        /// Get the port of the server to connect to
        /// </summary>
        int Port { get; }

        /// <summary>
        /// Get wether the connection is a secured connection
        /// </summary>
        bool IsSecuredConnection { get; }

        /// <summary>
        /// Get wether the socket is connected
        /// </summary>
        bool IsConnected { get; }
        
        /// <summary>
        /// Get the underlying transport stream when connected
        /// </summary>
        Stream TransportStream { get; }

        #endregion // Properties

        #region Methods

        /// <summary>
        /// Opens a connection to the server
        /// </summary>
        void Connect();

        /// <summary>
        /// Closes the connection to the server
        /// </summary>
        void Disconnect();

        #endregion // Methods
    }
}
